package test
{
	import flash.events.Event;
	
	import level4.display.GameDispose;
	import level4.engines.GameEngine;
	import level4.interfaces.IGameComponent;
	/**
	 * 游戏组件测试
	 * */
	public class Comp extends GameDispose implements IGameComponent
	{
		public var id:int;
		
		public function Comp(id:int)
		{
			this.id = id;
		}
		
		public function update(timeDiff:Number):void{
			graphics.beginFill(0xffffff * Math.random());
			graphics.drawRect(0,0,20,20);
			graphics.endFill();
			trace("id:",id,"timeDiff:",timeDiff);
		}
		
		override public function deInit(e:Event):void{
			super.deInit(e);
			GameEngine.removeComponent(this);
			trace("删除",id)
		}
	}
}